<template>
  <div class="family-dashboard">
    <!-- 顶部欢迎提示语 -->
    <div class="welcome-section">
      <h1 class="welcome-title">亲爱的{{ userInfo.name }}家属，欢迎来到智慧养老中心！</h1>
      <p class="welcome-subtitle">在这里，您的亲人将得到最贴心的关怀和专业的照护 💕</p>
    </div>

    <!-- 温馨关怀模块 -->
    <div class="care-section">
      <el-row :gutter="20">
        <el-col :span="8">
          <el-card class="care-card">
            <div class="care-icon">👵</div>
            <h3>长者近况</h3>
            <p>随时了解您亲人的健康状况和生活动态</p>
            <el-button type="primary" @click="$router.push('/dashboard/family/elder')">
              查看详情
            </el-button>
          </el-card>
        </el-col>
        <el-col :span="8">
          <el-card class="care-card">
            <div class="care-icon">🍽️</div>
            <h3>餐饮记录</h3>
            <p>了解长者每日的营养搭配和饮食情况</p>
            <el-button type="primary" @click="$router.push('/dashboard/family/meal')">
              查看详情
            </el-button>
          </el-card>
        </el-col>
        <el-col :span="8">
          <el-card class="care-card">
            <div class="care-icon">🚶</div>
            <h3>外出申请</h3>
            <p>为长者安排外出活动，丰富晚年生活</p>
            <el-button type="primary" @click="$router.push('/dashboard/family/outing')">
              申请外出
            </el-button>
          </el-card>
        </el-col>
      </el-row>
    </div>

    <!-- 养老中心宣传 -->
    <div class="promotion-section">
      <el-card class="promotion-card">
        <div class="promotion-content">
          <div class="promotion-text">
            <h2>用心守护 · 温暖相伴</h2>
            <p class="promotion-subtitle">让每一位长者都感受到家的温暖</p>
            
            <div class="promotion-features">
              <div class="feature-item">
                <i class="el-icon-house"></i>
                <div class="feature-content">
                  <h4>温馨家园</h4>
                  <p>舒适宜居的养老环境，让长者安享晚年</p>
                </div>
              </div>
              <div class="feature-item">
                <i class="el-icon-first-aid-kit"></i>
                <div class="feature-content">
                  <h4>专业照护</h4>
                  <p>24小时贴心服务，专业护理团队全程守护</p>
                </div>
              </div>
              <div class="feature-item">
                <i class="el-icon-chat-dot-round"></i>
                <div class="feature-content">
                  <h4>爱心陪伴</h4>
                  <p>心理关怀，情感支持，让关爱无处不在</p>
                </div>
              </div>
            </div>
          </div>
          <div class="promotion-image">
            <div class="image-placeholder">
              <i class="el-icon-picture"></i>
              <p>温馨养老环境</p>
            </div>
          </div>
        </div>
      </el-card>
    </div>

    <!-- 暖心话语 -->
    <div class="warm-words-section">
      <el-card class="warm-words-card">
        <div class="warm-words-content">
          <i class="el-icon-chat-line-square"></i>
          <div class="warm-words-text">
            <h3>致亲爱的家属们</h3>
            <p>"感谢您将亲人托付给我们，我们将以专业和爱心，让长者的每一天都充满温暖和关怀。在这里，我们不仅是照护者，更是温暖的家人。"</p>
            <p class="signature">—— 智慧养老中心全体工作人员</p>
          </div>
        </div>
      </el-card>
    </div>

    <!-- 快速操作 -->
    <div class="quick-actions-section">
      <h3 class="section-title">快速操作</h3>
      <el-row :gutter="15">
        <el-col :span="6">
          <div class="action-item" @click="$router.push('/dashboard/family/elder')">
            <div class="action-icon">👵</div>
            <span>查看长者信息</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="action-item" @click="$router.push('/dashboard/family/meal')">
            <div class="action-icon">🍽️</div>
            <span>查看餐饮记录</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="action-item" @click="$router.push('/dashboard/family/outing')">
            <div class="action-icon">🚶</div>
            <span>申请外出</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div class="action-item" @click="$router.push('/dashboard/family/outing-return')">
            <div class="action-icon">🏠</div>
            <span>外出返回</span>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script setup>
import { reactive } from 'vue'

// 用户信息
const userInfo = reactive(JSON.parse(localStorage.getItem('userInfo') || '{}'))
</script>

<style scoped>
.family-dashboard {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

.welcome-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.welcome-title {
  font-size: 2.5em;
  margin-bottom: 15px;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.welcome-subtitle {
  font-size: 1.3em;
  opacity: 0.9;
  font-weight: 300;
}

.care-section {
  margin-bottom: 40px;
}

.care-card {
  text-align: center;
  padding: 30px 20px;
  border-radius: 15px;
  border: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  background: white;
}

.care-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.care-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.care-card h3 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.4em;
}

.care-card p {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.promotion-section {
  margin-bottom: 40px;
}

.promotion-card {
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.promotion-content {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 30px;
}

.promotion-text {
  flex: 1;
}

.promotion-text h2 {
  font-size: 2.2em;
  color: #d63031;
  margin-bottom: 10px;
  font-weight: 600;
}

.promotion-subtitle {
  font-size: 1.2em;
  color: #636e72;
  margin-bottom: 30px;
  font-weight: 500;
}

.promotion-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.feature-item i {
  font-size: 1.8em;
  color: #e17055;
  width: 40px;
}

.feature-content h4 {
  margin: 0 0 5px 0;
  color: #2d3436;
  font-size: 1.1em;
}

.feature-content p {
  margin: 0;
  color: #636e72;
  font-size: 0.9em;
}

.promotion-image {
  flex-shrink: 0;
  width: 200px;
}

.image-placeholder {
  width: 100%;
  height: 150px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #636e72;
  border: 2px dashed rgba(99, 110, 114, 0.3);
}

.image-placeholder i {
  font-size: 2em;
  margin-bottom: 10px;
}

.warm-words-section {
  margin-bottom: 40px;
}

.warm-words-card {
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.warm-words-content {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 30px;
}

.warm-words-content i {
  font-size: 3em;
  color: #74b9ff;
  flex-shrink: 0;
}

.warm-words-text h3 {
  color: #2d3436;
  margin-bottom: 15px;
  font-size: 1.5em;
  font-weight: 600;
}

.warm-words-text p {
  color: #2d3436;
  line-height: 1.6;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.signature {
  text-align: right;
  font-style: italic;
  color: #636e72;
  margin-top: 15px;
}

.quick-actions-section {
  margin-bottom: 30px;
}

.section-title {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.5em;
  font-weight: 600;
  text-align: center;
}

.action-item {
  background: white;
  padding: 25px 15px;
  border-radius: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
}

.action-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-color: #667eea;
}

.action-icon {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.action-item span {
  color: #333;
  font-weight: 500;
  font-size: 0.95em;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .promotion-content {
    flex-direction: column;
    text-align: center;
  }
  
  .welcome-title {
    font-size: 2em;
  }
  
  .care-section .el-col {
    margin-bottom: 20px;
  }
  
  .quick-actions-section .el-col {
    margin-bottom: 15px;
  }
}
</style>
